<?php include dirname(__FILE__).'/common/header.php'; ?>

<?php include dirname(__FILE__).'/common/menu.php'; ?>

var attr = {};
attr.ctrlName = '<?php echo $ctrlName; ?>';
/*
| -------------------------------------------------------------------
|  List Grid
| -------------------------------------------------------------------
*/
list.grid = new ZM.GridPanel({
    url: list.baseUrl + attr.ctrlName+'/getApplyList',
    tbar:[{
        text:'导出过滤顾客',
        cls:'btn-show',
        hidden:!Ext.permission[attr.ctrlName + '/exportApplyList'.toLowerCase()],
        handler:function() {
            var sortInfo = list.grid.store.getSortState();
            if(sortInfo) {
                list.grid.store.baseParams['sort'] = sortInfo['field'];
                list.grid.store.baseParams['dir'] = sortInfo['direction'];
            }
            location.href = list.baseUrl + attr.ctrlName + '/exportApplyList?'+ Ext.urlEncode(list.grid.store.baseParams);
        }
    }],
    columns:[
        {header:'顾客ID',dataIndex:'customer_id',filter:{}},
        {header:'bluemember用户ID',dataIndex:'bluemember_user_id',width:200,filter:{}},
        {header:'bluemembers手机号',dataIndex:'bluemember_phone',width:200,filter:{}},
        {header:'姓名',dataIndex:'apply_name'},
        {header:'性别',dataIndex:'apply_sex',renderer:function(val) {
            return val == 1 ? '男' : '女';
        }},
        {header:'血型',dataIndex:'apply_blood'},
        {header:'国籍',dataIndex:'apply_nationality'},
        {header:'证件类型',dataIndex:'apply_id_type',renderer:function(val) {
            return val == 1 ? '身份证' : '';
        }},
        {header:'证件号',dataIndex:'apply_id_number'},
        {header:'出生日期',dataIndex:'apply_birthday'},
        {header:'手机号1',dataIndex:'apply_phone_1'},
        {header:'手机号2',dataIndex:'apply_phone_2'},
        {header:'电子邮箱1',dataIndex:'apply_email_1'},
        {header:'电子邮箱2',dataIndex:'apply_email_2'},
        {header:'省份',dataIndex:'apply_province'},
        {header:'城市',dataIndex:'apply_city'},
        {header:'地区',dataIndex:'apply_district'},
        {header:'通信地址',dataIndex:'apply_address'},
        {header:'邮编',dataIndex:'apply_zipcode'},
        {header:'紧急联系人',dataIndex:'apply_emergency_contact_name'},
        {header:'紧急联系人电话',dataIndex:'apply_emergency_contact_phone'},
        {header:'职业',dataIndex:'apply_job'},
        {header:'年收入',dataIndex:'apply_income'},
        {header:'教育程度',dataIndex:'apply_education'},
        {header:'既往病史',dataIndex:'apply_past_medical_history'},
        {header:'选手类型',dataIndex:'apply_player_type'},
        {header:'参加过的赛事',dataIndex:'apply_join_game_name'},
        {header:'完赛成绩',dataIndex:'apply_join_game_score'},
        {header:'一年内是否参加过马拉松',dataIndex:'apply_join_last_year',renderer:function(val) {
            return val == 1 ? '是' : '否'
        }},
        {header:'一年内最好成绩的赛事',dataIndex:'apply_join_last_year_name'},
        {header:'一年内最好成绩',dataIndex:'apply_join_last_year_score'},
        {header:'公益组织第一选项',dataIndex:'apply_mmunity_organization_1'},
        {header:'公益组织第二选项',dataIndex:'apply_mmunity_organization_2'},
        {header:'来源',dataIndex:'source'},
        {header:'创建时间',dataIndex:'apply_time_create',width:140,filter:{xtype:'datetimerangefield'}}
    ]
});
/*
| -------------------------------------------------------------------
|  List Grid Action
| -------------------------------------------------------------------
*/


<?php include dirname(__FILE__).'/common/layout.php'; ?>
list.grid.store.load();
<?php include dirname(__FILE__).'/common/footer.php'; ?>
